<MDXHeader
  title="Switch"
  description="A control that allows the user to toggle between checked and not checked."
  docs="https://kobalte.dev/docs/core/components/switch"
/>

<ComponentPreview name="switch-demo" />

## Installation

<Tabs defaultValue="cli">

<TabsList>
  <TabsTrigger value="cli">CLI</TabsTrigger>
  <TabsTrigger value="manual">Manual</TabsTrigger>
</TabsList>

<TabsContent value="cli">

```bash
npx solidui-cli@latest add switch
```

</TabsContent>

<TabsContent value="manual">
<Steps>

<Step>Install the following dependencies: </Step>

```bash
npm install @kobalte/core
```

<Step>Copy and paste the following code into your project: </Step>

<ComponentSource name="switch" />

</Steps>
</TabsContent>

</Tabs>

## Usage

```tsx
import { Switch, SwitchControl, SwitchThumb } from "~/components/ui/switch"
```

```tsx
<Switch>
  <SwitchControl>
    <SwitchThumb />
  </SwitchControl>
</Switch>
```
